import React from 'react'
import {
    BrowserRouter,
    Routes,
    Route,
    Navigate,
    NavLink,
} from 'react-router-dom'
import About from '../views/About'
import Home from '../views/Home'

export default function Index() {
    return (
        <BrowserRouter>
            <NavLink to="/">首页</NavLink> | <NavLink to="/about">关于</NavLink>
            <Routes>
                <Route path="/" element={<Navigate to="/home" />}></Route>
                <Route path="/home" element={<Home />}></Route>
                <Route path="/about" element={<About />}></Route>
            </Routes>
        </BrowserRouter>
    )
}
